package com.kmproject.haifu.mvp.model.api.service;

import com.kmproject.haifu.mvp.model.api.Api;
import com.kmproject.haifu.mvp.model.entity.ResultBean;
import com.kmproject.haifu.mvp.model.entity.beans.MyStoryBean;
import com.kmproject.haifu.mvp.model.entity.beans.ObtainedSecondHandBean;
import com.kmproject.haifu.mvp.model.entity.beans.PublishNumCheakBean;
import com.kmproject.haifu.mvp.model.entity.beans.SecondHandCategoryBean;
import com.kmproject.haifu.mvp.model.entity.beans.SecondHandInfoBean;

import com.kmproject.haifu.mvp.model.entity.beans.SecondHandTreeTypeBean;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

public interface SecondhandService {
    //获取二手物品发布类型树
    @GET(Api.SECONDHAND_PUBLISH_SELECT_TYPE)
    Observable<ResultBean<List<SecondHandTreeTypeBean>>> secondHandCategoryTree();

    //获取二手物品发布类型树
    @POST(Api.SECONDHAND_PUBLISH_SELECT_STORE)
    Observable<ResultBean<List<MyStoryBean.ResultBean>>> getCurrentUserStoreList(@Body RequestBody body);

    //发布二手物品
    @POST(Api.SECONDHAND_PUBLISH_PUBLISH_ADD)
    Observable<ResultBean<SecondHandInfoBean>> secondHandAdd(@Body RequestBody body);

    //编辑二手物品
    @POST()
    Observable<ResultBean<SecondHandInfoBean>> secondHandEdit(@Url String url, @Body RequestBody body);

    //查询详情
    @GET()
    Observable<ResultBean<SecondHandInfoBean>> secondHandLookOne(@Url String url);

    //是否可以发布二手物品和房源
    @GET(Api.SECONDHAND_PUBLISH_PUBLISH_ISPUBLISH)
    Observable<ResultBean<PublishNumCheakBean>> isPublishCount();


    //查询二手物品
    @POST(Api.SECONDHAND_LISTSECONDHAND)
    Observable<ResultBean<List<SecondHandInfoBean>>> listSecondHand(@Body RequestBody body);

    //查询二手物品分类
    @GET(Api.SECONDHAND_LISTTREE)
    Observable<ResultBean<List<SecondHandCategoryBean>>> listSecondCategory(@Query("categoryId") String categoryId, @Query("name") String name, @Query(" parentId") String parentId);

    //查询我关注的二手物品店铺和人
    @POST(Api.SECONDHAND_LIST_MYATTENTTION)
    Observable<ResultBean<List<SecondHandInfoBean>>> myAttention(@Body RequestBody body);


    //下架二手物品
    @FormUrlEncoded
    @POST(Api.SECONDHAND_LOWERSHELF)
    Observable<ResultBean> lowerShelfSecondHand(@Field("lowerShelfReason") String lowerShelfReason, @Field("secondHandId") String secondHandId);

    //添加二手物品收藏 /{secondHandId}  Api.SECONDHAND_COLLECT
    @POST()
    Observable<ResultBean> collestSecondHand(@Url String url);

    //取消二手物品收藏 /{secondHandId}
    @POST(Api.SECONDHAND_CANCELCOLLECT)
    Observable<ResultBean> cancelCollestSecondHand(@Body RequestBody body);
    //取消二手物品收藏 /{secondHandId}
//    {
//        "secondHandIds": []
//    }


    //删除二手物品
    @FormUrlEncoded
    @POST(Api.SECONDHAND_DEL)
    Observable<ResultBean> remoredSencond(@Field("secondHandId") String secondHandId);


      //当前用户(店主)查询店铺下的二手物品/app/secondHand/listSecondHand/currentUser/store/
    @POST()
    Observable<ResultBean<List<SecondHandInfoBean>>> listSecondHandBycurrentUser(@Url String url, @Body RequestBody body);

    //根据店铺查询二手物品 /app/secondHand/listSecondHand/store/{storeId}
    @POST()
    Observable<ResultBean<List<SecondHandInfoBean>>> listSecondHandBystore(@Url String url, @Body RequestBody body);

    //查询二手物品下架信息
    @POST("app/secondHand/getLowerShelfList")
    Observable<ResultBean<List<ObtainedSecondHandBean>>> getLowerShelfList(@Body RequestBody body);


    //二手物品导入店铺
    @POST()
    Observable<ResultBean> importSecondhanToStore(@Url String url, @Body RequestBody body);

    //查询二手物品下架信息
    @POST(Api.SECONDHAND_QUERY_IMPORT)
    Observable<ResultBean<List<SecondHandInfoBean>>> querySecondHandToImport(@Body RequestBody body);


    //查询我的发布二手物品
    @POST(Api.SECONDHAND_QUEY_MY_PUBLISH_SECONDHND)
    Observable<ResultBean<List<SecondHandInfoBean>>> mySecondHandList(@Body RequestBody body);

    //查询我的收藏的二手物品
    @POST(Api.SECONDHAND_QUEY_MY_DECONDHSND_COLLECT)
    Observable<ResultBean<List<SecondHandInfoBean>>> myCollectionSecondHandList(@Body RequestBody body);

    //查询个人中心二手物品列表
    @POST()
    Observable<ResultBean<List<SecondHandInfoBean>>> userSecondHand(@Url String url,@Body RequestBody body);

}
